diff options
| author | Fuwn <[email protected]> | 2024-10-09 00:41:20 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-09 00:41:43 -0700 |
| commit | 998b63a35256ac985a5a2714dd1ca451af4dfd8a (patch) | |
| tree | 50796121a9d5ab0330fdc5d7e098bda2860d9726 /src/routes/tools/[tool] | |
| parent | feat(graphql): add badgeCount field (diff) | |
| download | due.moe-998b63a35256ac985a5a2714dd1ca451af4dfd8a.tar.xz due.moe-998b63a35256ac985a5a2714dd1ca451af4dfd8a.zip | |
chore(prettier): use spaces instead of tabs
Diffstat (limited to 'src/routes/tools/[tool]')
| -rw-r--r-- | src/routes/tools/[tool]/+page.server.ts | 6 | ||||
| -rw-r--r-- | src/routes/tools/[tool]/+page.svelte | 136 |
2 files changed, 71 insertions, 71 deletions
diff --git a/src/routes/tools/[tool]/+page.server.ts b/src/routes/tools/[tool]/+page.server.ts index c7e72d18..11ba6d15 100644 --- a/src/routes/tools/[tool]/+page.server.ts +++ b/src/routes/tools/[tool]/+page.server.ts @@ -1,5 +1,5 @@ export const load = ({ params }) => { - return { - tool: params.tool - }; + return { + tool: params.tool + }; }; diff --git a/src/routes/tools/[tool]/+page.svelte b/src/routes/tools/[tool]/+page.svelte index 3749c096..9140ae1c 100644 --- a/src/routes/tools/[tool]/+page.svelte +++ b/src/routes/tools/[tool]/+page.svelte @@ -1,84 +1,84 @@ <script lang="ts"> - import Hayai from './../../../lib/Tools/Hayai.svelte'; - import UmaMusumeBirthdays from './../../../lib/Tools/UmaMusumeBirthdays.svelte'; - import ActivityHistory from '$lib/Tools/ActivityHistory/Tool.svelte'; - import Wrapped from '$lib/Tools/Wrapped/Tool.svelte'; - import EpisodeDiscussionCollector from '$lib/Tools/EpisodeDiscussionCollector.svelte'; - import CharacterBirthdays from '$lib/Tools/Birthdays.svelte'; - import SequelSpy from '$lib/Tools/SequelSpy/Tool.svelte'; - import { closest } from '$lib/Error/path'; - import HeadTitle from '$lib/Home/HeadTitle.svelte'; - import RandomFollower from '$lib/Tools/RandomFollower.svelte'; - import DumpProfile from '$lib/Tools/DumpProfile.svelte'; - import { tools } from '$lib/Tools/tools.js'; - import { onMount } from 'svelte'; - import { goto } from '$app/navigation'; - import Picker from '$lib/Tools/Picker.svelte'; - import Likes from '$lib/Tools/Likes.svelte'; - import root from '$lib/Utility/root.js'; - import Popup from '$lib/Layout/Popup.svelte'; - import HololiveBirthdays from '$lib/Tools/HololiveBirthdays.svelte'; - import SequelCatcher from '$lib/Tools/SequelCatcher/Tool.svelte'; + import Hayai from './../../../lib/Tools/Hayai.svelte'; + import UmaMusumeBirthdays from './../../../lib/Tools/UmaMusumeBirthdays.svelte'; + import ActivityHistory from '$lib/Tools/ActivityHistory/Tool.svelte'; + import Wrapped from '$lib/Tools/Wrapped/Tool.svelte'; + import EpisodeDiscussionCollector from '$lib/Tools/EpisodeDiscussionCollector.svelte'; + import CharacterBirthdays from '$lib/Tools/Birthdays.svelte'; + import SequelSpy from '$lib/Tools/SequelSpy/Tool.svelte'; + import { closest } from '$lib/Error/path'; + import HeadTitle from '$lib/Home/HeadTitle.svelte'; + import RandomFollower from '$lib/Tools/RandomFollower.svelte'; + import DumpProfile from '$lib/Tools/DumpProfile.svelte'; + import { tools } from '$lib/Tools/tools.js'; + import { onMount } from 'svelte'; + import { goto } from '$app/navigation'; + import Picker from '$lib/Tools/Picker.svelte'; + import Likes from '$lib/Tools/Likes.svelte'; + import root from '$lib/Utility/root.js'; + import Popup from '$lib/Layout/Popup.svelte'; + import HololiveBirthdays from '$lib/Tools/HololiveBirthdays.svelte'; + import SequelCatcher from '$lib/Tools/SequelCatcher/Tool.svelte'; - export let data; + export let data; - let tool = data.tool ?? 'default'; + let tool = data.tool ?? 'default'; - onMount(() => { - if (tool === 'default') goto(root('/tools')); - }); + onMount(() => { + if (tool === 'default') goto(root('/tools')); + }); - $: suggestion = closest(tool, Object.keys(tools)); + $: suggestion = closest(tool, Object.keys(tools)); - $: if (tool == 'girls') goto(root('/girls')); + $: if (tool == 'girls') goto(root('/girls')); </script> <Picker bind:tool /> {#if !Object.keys(tools).includes(tool)} - <HeadTitle route="Tools" path="/tools" /> + <HeadTitle route="Tools" path="/tools" /> - <Popup> - <p style="text-align: center;"> - Tool "<a href={root(`/tools/${tool}`)}>{tool}</a>" not found - </p> + <Popup> + <p style="text-align: center;"> + Tool "<a href={root(`/tools/${tool}`)}>{tool}</a>" not found + </p> - <blockquote style="margin: 0 0 0 1.5rem;"> - Did you mean "<a - href={root(`/tools/${tools[suggestion].id}`)} - on:click={() => (tool = suggestion)} - style={suggestion === '...' ? 'pointer-events: none; color: inherit;' : ''} - > - {suggestion === '...' ? '...' : tools[suggestion].name()}</a - >"? - </blockquote> - </Popup> + <blockquote style="margin: 0 0 0 1.5rem;"> + Did you mean "<a + href={root(`/tools/${tools[suggestion].id}`)} + on:click={() => (tool = suggestion)} + style={suggestion === '...' ? 'pointer-events: none; color: inherit;' : ''} + > + {suggestion === '...' ? '...' : tools[suggestion].name()}</a + >"? + </blockquote> + </Popup> {:else} - <HeadTitle route={tools[tool].name()} path={`/tools?tool=${tool}`} /> + <HeadTitle route={tools[tool].name()} path={`/tools?tool=${tool}`} /> - {#if tool === 'activity_history'} - <ActivityHistory user={data.user} /> - {:else if tool === 'wrapped'} - <Wrapped user={data.user} /> - {:else if tool === 'discussions'} - <EpisodeDiscussionCollector /> - {:else if tool === 'birthdays'} - <CharacterBirthdays /> - {:else if tool === 'sequel_spy'} - <SequelSpy user={data.user} /> - {:else if tool === 'random_follower'} - <RandomFollower /> - {:else if tool === 'dump_profile'} - <DumpProfile /> - {:else if tool === 'likes'} - <Likes /> - {:else if tool === 'uma_musume_birthdays'} - <UmaMusumeBirthdays /> - {:else if tool === 'hayai'} - <Hayai /> - {:else if tool === 'hololive_birthdays'} - <HololiveBirthdays /> - {:else if tool === 'sequel_catcher'} - <SequelCatcher user={data.user} /> - {/if} + {#if tool === 'activity_history'} + <ActivityHistory user={data.user} /> + {:else if tool === 'wrapped'} + <Wrapped user={data.user} /> + {:else if tool === 'discussions'} + <EpisodeDiscussionCollector /> + {:else if tool === 'birthdays'} + <CharacterBirthdays /> + {:else if tool === 'sequel_spy'} + <SequelSpy user={data.user} /> + {:else if tool === 'random_follower'} + <RandomFollower /> + {:else if tool === 'dump_profile'} + <DumpProfile /> + {:else if tool === 'likes'} + <Likes /> + {:else if tool === 'uma_musume_birthdays'} + <UmaMusumeBirthdays /> + {:else if tool === 'hayai'} + <Hayai /> + {:else if tool === 'hololive_birthdays'} + <HololiveBirthdays /> + {:else if tool === 'sequel_catcher'} + <SequelCatcher user={data.user} /> + {/if} {/if} |